<template>
    <div class="repairSuccess">
        <div class="repairSuccessTop">
            <i class="iconfont icon-icon-test"></i>
            <span>预约成功</span>
        </div>
        <div class="sdDredge">
            <h2 class="repairTit">
                <strong></strong>
                <span>订单详情</span>
            </h2>
            <div class="repairSuccessContent">
                <p><span>服务订单：</span>{{ orderData.orderNumber }}</p>
                <p><span>服务时间：</span>{{ orderData.scheduledTime }}</p>
                <p><span>服务项目：</span>{{ orderData.cmItemName }}</p>
                <p><span>联系人：</span>{{ orderData.userName }}</p>
                <p><span>联系电话：</span>{{ orderData.userMobile }}</p>
                <p><span>地址：</span>{{ orderData.userAddress }}</p>
            </div>
            <div class="repairSuccessbtn">
                <button class="Successbtn" @click="sure">确认</button>
                <button class="Successbtn Successbtn1" @click="back">返回</button>
            </div>
        </div>
    </div>
</template>

<script>
import { mapState, mapActions } from 'vuex'
export default {
    created(){
        if(this.orderData.orderNumber){
            this.repairOrderData({orderNumber:this.orderData.orderNumber});
        }else{
            this.$router.push('/orderList')
        }
    },
    computed: {
        ...mapState({
            orderData: state => state.repairModule.orderData
        }),
    },
    mounted(){
        
    },
    methods:{
        ...mapActions({
            repairOrderData:"repairModule/repairOrderData"
        }),
        sure(){
            console.log(this.orderData)
            this.$router.push('/orderList')
        },
        back(){
            this.$router.push('/repair')
        }
    }
}
</script>


<style lang="scss">
    @import '@/assets/style/repair.scss';
</style>
